package org.shangrila.bme.eo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * The persistent class for the bme_receipt database table.
 * 
 */
@Entity
@Table(name="bme_receipt")
@NamedQuery(name="BmeReceipt.findAll", query="SELECT b FROM BmeReceipt b")
public class BmeReceipt implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	private String address;

	@Column(name="ANNEX_FLAG")
	private int annexFlag;

	private String consignee;

	@Column(name="CONT_NAME")
	private String contName;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME")
	private Date createTime;

	private String driver;

	private String lpn;

	private String operator;

	private String phone;

	
	private String remarks;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="SEND_DATE")
	private Date sendDate;

	private String status;

	private String supplier;

	//bi-directional many-to-one association to BmeContract
	@ManyToOne
	@JoinColumn(name="CONT_ID")
	private BmeContract bmeContract;

	//bi-directional many-to-one association to BmePurchOrder
	@ManyToOne
	@JoinColumn(name="PURCH_ID")
	private BmePurchOrder bmePurchOrder;

	//bi-directional many-to-one association to BmeReceiptDetail
	@OneToMany(mappedBy="bmeReceipt")
	private List<BmeReceiptDetail> bmeReceiptDetails;

	public BmeReceipt() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getAnnexFlag() {
		return this.annexFlag;
	}

	public void setAnnexFlag(int annexFlag) {
		this.annexFlag = annexFlag;
	}

	public String getConsignee() {
		return this.consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}

	public String getContName() {
		return this.contName;
	}

	public void setContName(String contName) {
		this.contName = contName;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getDriver() {
		return this.driver;
	}

	public void setDriver(String driver) {
		this.driver = driver;
	}

	public String getLpn() {
		return this.lpn;
	}

	public void setLpn(String lpn) {
		this.lpn = lpn;
	}

	public String getOperator() {
		return this.operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public Date getSendDate() {
		return this.sendDate;
	}

	public void setSendDate(Date sendDate) {
		this.sendDate = sendDate;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSupplier() {
		return this.supplier;
	}

	public void setSupplier(String supplier) {
		this.supplier = supplier;
	}

	public BmeContract getBmeContract() {
		return this.bmeContract;
	}

	public void setBmeContract(BmeContract bmeContract) {
		this.bmeContract = bmeContract;
	}

	public BmePurchOrder getBmePurchOrder() {
		return this.bmePurchOrder;
	}

	public void setBmePurchOrder(BmePurchOrder bmePurchOrder) {
		this.bmePurchOrder = bmePurchOrder;
	}

	public List<BmeReceiptDetail> getBmeReceiptDetails() {
		return this.bmeReceiptDetails;
	}

	public void setBmeReceiptDetails(List<BmeReceiptDetail> bmeReceiptDetails) {
		this.bmeReceiptDetails = bmeReceiptDetails;
	}

	public BmeReceiptDetail addBmeReceiptDetail(BmeReceiptDetail bmeReceiptDetail) {
		getBmeReceiptDetails().add(bmeReceiptDetail);
		bmeReceiptDetail.setBmeReceipt(this);

		return bmeReceiptDetail;
	}

	public BmeReceiptDetail removeBmeReceiptDetail(BmeReceiptDetail bmeReceiptDetail) {
		getBmeReceiptDetails().remove(bmeReceiptDetail);
		bmeReceiptDetail.setBmeReceipt(null);

		return bmeReceiptDetail;
	}

}